import { BaseScanSeries, NormalScanSeries } from '@renderer/views/multiScanSeriesPage/types'

const getSeriesKeywords = (series: BaseScanSeries | NormalScanSeries) => {
  return `${series.keywords.kV.value}kV,${series.keywords.mA.value}mA `
}

function convertImgArr2Map(imgList: any): Map<string, any> {
  const imgs = new Map()
  for (const [k, v] of Object.entries(imgList)) {
    const imgNameArr = k.split('/')
    const imgNameWithSuffix = imgNameArr[imgNameArr.length - 1]
    const imgName = imgNameWithSuffix.split('.')[0]
    imgs.set(imgName,(v as any).default)
  }
  return imgs
}


export {
  getSeriesKeywords,
  convertImgArr2Map
}
